{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e5bb6f6c",
   "metadata": {},
   "source": [
    "# 上周回顾  \n",
    "> 1.函数的定义 ： def  \n",
    "> 2.函数名的定义规则-->变量名一样的规则  \n",
    "> 3.调用函数的方式  \n",
    "> 4.参数：  \n",
    ">>形式参数（定义函数）  \n",
    ">>实际参数（调用函数）  \n",
    ">>有多个参数时：  \n",
    ">>>关键字参数  \n",
    ">>>位置参数（调用函数时）---> 关键字参数要均放在末尾（多个不考虑顺序）  \n",
    ">>>默认参数（定义函数时）---> 默认参数均放在末尾（多个不考虑顺序）  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5e1e021b",
   "metadata": {},
   "source": [
    "# 本周知识\n",
    ">1.函数的返回值  \n",
    ">2.函数的参数类型  \n",
    ">3.模块与函数的关系  \n",
    ">4.定义一个模块，然后调用模块  \n",
    ">>A.调用模块  \n",
    ">>B.调用模块中的函数  \n",
    ">5.模块与函数实践  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "183e3c85",
   "metadata": {},
   "source": [
    "# 函数的返回值\n",
    "> 1.函数一定有返回值（无论什么编程语言）  \n",
    "> 2.在其他的编程语言中（如c语言，java等），一般返回值一定要写，不写会报错；但是在python中，return可以不写，return 默认为 None\n",
    "> 3,返回值一般为函数体运行的结果（result）（函数返回值实践1）也可以是自定义的函数返回值（实践2）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "b3240ec9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 函数返回值实践1\n",
    "def get_formatted_name(first_name,last_name):\n",
    "    \"\"\"返回整洁的姓名\"\"\"\n",
    "    full_name = first_name + ' '+ last_name\n",
    "#     函数的返回结果为 full_name\n",
    "    return full_name\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "9aac74ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'tu lulu'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_formatted_name(\"tu\",\"lulu\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "4eb6f3b0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tu lulu\n"
     ]
    }
   ],
   "source": [
    "print(get_formatted_name(\"tu\",\"lulu\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "400641ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践2\n",
    "def log_in(username,password):\n",
    "    \"\"\"验证登陆信息\"\"\"\n",
    "    if username == \"tululu\" and password == 123456:\n",
    "        return 1\n",
    "    else:\n",
    "        return 0\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "551de91c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "log_in(\"tululu\",123456)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d22d881b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "log_in(\"tululu\",1234567)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6d3b8b7a",
   "metadata": {},
   "source": [
    "# 函数的参数  \n",
    "#####  1.函数输入的参数  \n",
    ">> 1.函数可以输入复杂的参数：  \n",
    ">> 函数参数为列表  \n",
    ">> 函数参数为字典  \n",
    ">> 2.函数可以输入不确定个数的参数  \n",
    ">>A.* args  \n",
    ">>B.** kwargs  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "54e5303a",
   "metadata": {},
   "outputs": [],
   "source": [
    "def list_test(names):\n",
    "    \"\"\"测试输入参数为列表\"\"\"\n",
    "    print(names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "0bea7f16",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['tululu', 'lihua', 'xiaofeng']\n"
     ]
    }
   ],
   "source": [
    "list_test([\"tululu\",\"lihua\",\"xiaofeng\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "e92ed3b0",
   "metadata": {},
   "outputs": [],
   "source": [
    "def dict_test(request_header):\n",
    "    \"\"\"函数输入一个字典\"\"\"\n",
    "    print(request_header)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "0f4faf75",
   "metadata": {},
   "outputs": [],
   "source": [
    "# http://httpbin.org/get\n",
    "# https://httpbin.org/get\n",
    "httpbin_get={\n",
    "  \"args\": {}, \n",
    "  \"headers\": {\n",
    "    \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\", \n",
    "    \"Accept-Encoding\": \"gzip, deflate\", \n",
    "    \"Accept-Language\": \"zh-CN,zh;q=0.9\", \n",
    "    \"Host\": \"httpbin.org\", \n",
    "    \"Upgrade-Insecure-Requests\": \"1\", \n",
    "    \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36\", \n",
    "    \"X-Amzn-Trace-Id\": \"Root=1-61adb9c8-520e9a5303141f7323a30ca8\"\n",
    "  }, \n",
    "  \"origin\": \"112.96.164.197\", \n",
    "  \"url\": \"http://httpbin.org/get\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "6dea92f6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Host': 'httpbin.org', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36', 'X-Amzn-Trace-Id': 'Root=1-61adb9c8-520e9a5303141f7323a30ca8'}\n"
     ]
    }
   ],
   "source": [
    "# 调用函数时，给一个字典作为输入值\n",
    "dict_test(httpbin_get[\"headers\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "360f81fe",
   "metadata": {},
   "source": [
    "> 2.函数可以输入不确定个数的参数  \n",
    ">>A.* args  \n",
    ">>args 可以接受多个数据（单值）  \n",
    ">>args 将多个数据存在一个元组当中，实际还是一个变量  \n",
    "\n",
    ">>B.** kwargs  \n",
    ">>kwargs 可以接受多个数据(键值对)==> 关键字参数  \n",
    ">>kwargs 将多个 键值对 的数据存放在一个 字典 中，实际上还是一个变量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "ac512981",
   "metadata": {},
   "outputs": [],
   "source": [
    "# A.* args  \n",
    "def food_ingred(food,*ingred):\n",
    "    \"\"\"食物配料表\"\"\"\n",
    "    return food,ingred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "ca9c2be4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('pizaa', ('mushroom', 'pepers', 'cheese'))"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "food_ingred(\"pizaa\",\"mushroom\",\"pepers\",\"cheese\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "f897ce76",
   "metadata": {},
   "outputs": [],
   "source": [
    "# **kwargs\n",
    "def person(stud_name,**stud_info):\n",
    "    \"\"\"学生个人信息完善表\"\"\"\n",
    "    return stud_name,stud_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "7ab8555c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('Lihua', {'age': 18, 'job': 'student', 'address': '广州南方学院'})"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "person(\"Lihua\",age=18,job=\"student\",address=\"广州南方学院\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "69048123",
   "metadata": {},
   "source": [
    "##### 2.函数输出的返回值\n",
    "> 1.返回值可以是字符串，数值，列表，字典等数据（单一值）  \n",
    "> 2.返回值是唯一的，不可以有两个（这是其他的语言，如c语言，Java等）  \n",
    "> 3.python可以输出多个返回值，结果会用一个元组进行封装并返回。（本质不违背函数的定义）  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "db89d72b",
   "metadata": {},
   "outputs": [],
   "source": [
    "def test1_return():\n",
    "    \"\"\"测试返回值\"\"\"\n",
    "    return\"你好\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "2b543e13",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'你好'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test1_return()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "0e615569",
   "metadata": {},
   "outputs": [],
   "source": [
    "def test2_return():\n",
    "    \"\"\"测试返回值\"\"\"\n",
    "    return 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "6eae75ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test2_return()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "fa7cf554",
   "metadata": {},
   "outputs": [],
   "source": [
    "def test3_return():\n",
    "    \"\"\"测试返回值\"\"\"\n",
    "    return [0,1,2,3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "a1de0241",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3]"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test3_return()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "1539f264",
   "metadata": {},
   "outputs": [],
   "source": [
    "def test4_return():\n",
    "    \"\"\"测试返回值\"\"\"\n",
    "    return httpbin_get[\"headers\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "6ff8daad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',\n",
       " 'Accept-Encoding': 'gzip, deflate',\n",
       " 'Accept-Language': 'zh-CN,zh;q=0.9',\n",
       " 'Host': 'httpbin.org',\n",
       " 'Upgrade-Insecure-Requests': '1',\n",
       " 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36',\n",
       " 'X-Amzn-Trace-Id': 'Root=1-61adb9c8-520e9a5303141f7323a30ca8'}"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test4_return()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "bcb345ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "#测试多个值\n",
    "def test5_return():\n",
    "    \"\"\"测试返回值\"\"\"\n",
    "    return 1,2,\"tululu\",[1,2,3],httpbin_get[\"headers\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "520fb295",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1,\n",
       " 2,\n",
       " 'tululu',\n",
       " [1, 2, 3],\n",
       " {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',\n",
       "  'Accept-Encoding': 'gzip, deflate',\n",
       "  'Accept-Language': 'zh-CN,zh;q=0.9',\n",
       "  'Host': 'httpbin.org',\n",
       "  'Upgrade-Insecure-Requests': '1',\n",
       "  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36',\n",
       "  'X-Amzn-Trace-Id': 'Root=1-61adb9c8-520e9a5303141f7323a30ca8'})"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test5_return()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b48b7bf2",
   "metadata": {},
   "source": [
    "# 模块\n",
    "> 1.使用模块可以隐藏函数的源代码\n",
    "> 2.\n",
    "> 3.调用模块的方法  \n",
    ">>必须先调用模块，才可以使用\n",
    ">>>import moudle_name 直接调用整个模块，此时模块的所有函数处于备用状态，使用的方法为：moudle_name.func_name()  \n",
    ">>>from moudle_name import func_name,此时，仅调用模块的某一个函数，只能使用这个模块的该函数，使用方法为 func_name()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "73056457",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2021, tm_mon=12, tm_mday=6, tm_hour=16, tm_min=35, tm_sec=24, tm_wday=0, tm_yday=340, tm_isdst=0)"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 调用模块的方法一：调用整个模块\n",
    "import time\n",
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "350e3b9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'e', 'o', 'u'}"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import study\n",
    "study.search4vowels('hello tululu')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "55a6bb96",
   "metadata": {},
   "outputs": [],
   "source": [
    "from study import news_链接 #该方法不需要再写模块的名字+.func_name()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f652c344",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['https://www.nfu.edu.cn/xxyw/index.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index1.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index2.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index3.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index4.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index5.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index6.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index7.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index8.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index9.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index10.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index11.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index12.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index13.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index14.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index15.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index16.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index17.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index18.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index19.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index20.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index21.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index22.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index23.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index24.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index25.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index26.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index27.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index28.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index29.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index30.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index31.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index32.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index33.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index34.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index35.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index36.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index37.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index38.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index39.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index40.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index41.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index42.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index43.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index44.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index45.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index46.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index47.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index48.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index49.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index50.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index51.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index52.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index53.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index54.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index55.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index56.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index57.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index58.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index59.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index60.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index61.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index62.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index63.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index64.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index65.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index66.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index67.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index68.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index69.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index70.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index71.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index72.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index73.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index74.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index75.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index76.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index77.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index78.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index79.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index80.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index81.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index82.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index83.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index84.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index85.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index86.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index87.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index88.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index89.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index90.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index91.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index92.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index93.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index94.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index95.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index96.htm',\n",
       " 'https://www.nfu.edu.cn/xxyw/index97.htm']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "news_链接('https://www.nfu.edu.cn/','xxyw','98')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b0d1aa74",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
